CC		= gcc
CFLAGS	=
LFLAGS	= -fPIC -g -c -Wall
LINK	= -Wl
LLIB	= -lc
LIBS	=

OBJ		= dlmd.o log.o request.o reply.o lock.o
LIBOBJ	= libdlm.o

all: dlmd libdlm

$(OBJ:.o=.c): $*
	$(CC) $(CFLAGS) $*

$(LIBOBJ:.o=.c): $*
	$(CC) $(LFLAGS) $*
	
dlmd: $(OBJ)
	$(CC) -Wl -o dlmd $(OBJ) $(LIBS)
	
libdlm: $(LIBOBJ)
	$(CC) -shared -Wl,-soname,libdlm.so.1 -o libdlm.so.1.0 $(LIBOBJ) $(LLIBS)

clean:
	rm -f *.o *.so.* dlmd
	